Advertisement
Guest User

probetool.ngc

a guest
Dec 31st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. o<probetool> sub
  2.  
  3. ; todo; probe health check before operation
  4.  
  5. #<probe_center_x> = 461.5
  6. #<probe_center_y> = 244.437
  7.  
  8. o101 IF [#<_current_tool> EQ 0]
  9. (abort, "No tool selected")
  10. o101 ENDIF
  11.  
  12. G90 ; Absolute
  13.  
  14. G53 Z400 ; Go to known save Z height
  15. ; and store the current coordinate system offset
  16. #<z_offset> = [#5422]
  17. #<probe_to> = [#<z_offset> - 400]
  18.  
  19. o102 IF [#5413 EQ 2]
  20. ; If this is a pointy tool go to center
  21. G53 G0 X#<probe_center_x> Y#<probe_center_y>
  22. M5 ; Make sure spindle is stopped
  23. o102 ELSE
  24. ; Move to toolsetter - tool radius is (#5401 diameter) / 2
  25. G53 G0 X#<probe_center_x> Y[#<probe_center_y> - [#5410 / 2]]
  26.  
  27. ; Spindle backwards
  28. M4 S200
  29. o102 ENDIF
  30.  
  31. ; Probe down "fast"
  32. G90 G38.2 Z#<probe_to> F600
  33.  
  34. ; Incremental up 3mm
  35. G91 G0 Z3
  36.  
  37. ; Probe slowly
  38. G90 G38.2 Z#<probe_to> F50
  39.  
  40. G91 G0 Z20
  41.  
  42. ; Store offset (minus the 20mm we moved up)
  43. G10 L10 P#<_current_tool> Z20
  44.  
  45. M5
  46.  
  47. (debug, Tool #<_current_tool> new Z offset = #5403)
  48. o<probetool> endsub
  49. M2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement